﻿using System;
using System.Net;
using MagickNet;

namespace MagickServer.Services {
    public class UrlFetchingImageSource : IImageSource {
        public Image GetImage(string key) {
            var req = WebRequest.Create(key);
            using (var response = req.GetResponse())
            using (var responseStream = response.GetResponseStream())
                return new Image(responseStream);
        }
    }
}